﻿using System;
using System.Collections.Generic;
using System.IO;

namespace TaiwuModFramework.Common.Abstract {
    public abstract class ALogWriter {

        public abstract string LogPath { get; }


        private protected ALogWriter() { }

        public abstract void WriteLines(IEnumerable<object> lines);

        public abstract void WriteLine(object o);


        public static string CalcKey(params object[] args) {
            throw new Exception("该类没有重写ALogWriter.CalcKey, 参数需为 params object[] args 且参数数量、类型、顺序与构造方法一致");
        }

        public bool FileExists() {
            return LogPath == null ? false : File.Exists(LogPath);
        }
    }
}
